import React, { Component } from 'react';
import './App.scss'
import Drag from './components/Drag'
import Mess from './components/Mess'
class App extends Component {
  state = {
    visible: false,
    dragList: ['哈哈']
  }
  render() {
    const { visible, dragList } = this.state
    return (
      <div>
        <button onClick={ () => this.setState({ visible: true }) }>发布一个拖拽标题！</button>
        <Mess visible={ visible } 
          closeMess={ () => this.setState({ visible: false })}
          submit={ (value) => this.setState({ dragList: [...dragList, value] }) }
        ></Mess>
        <Drag dragList={ dragList }></Drag>
      </div>
    );
  }
}

export default App;
